package org.spindle.soasuite.datasource.internal.core;

import org.hibernate.Query;
import org.spindle.soasuite.data.internal.MockService;
import org.spindle.soasuite.datasource.internal.api.IEndpointDAO;


class EndpointDAO extends ADatasourceDAO  implements IEndpointDAO {
    @Override
    public MockService getEndpoint(String endpoint) {
        MockService service = null;

        Query q = prepareQuery("select s from mock_service as s where s.endpoint=:endpoint");
        q.setString("endpoint", endpoint);
        service = (MockService) q.uniqueResult();

        return service;
    }
}
